<template>
	<view class="content-tabar">
		<view class="header">
			<view class="header-text"></view>
			<view class="header-text">首页</view>
		</view>
		<view class="banner">
			<image src="../../static/index/banner.png" mode="widthFix"></image>
		</view>
		<view class="tuijian">推荐商品</view>
		<scroll-view :scroll-y="true" class="goods-scroll">
			<view class="gooods-header">
				<view class="gooods-centent flex-row flex-content-start flex-wrap">
					<view class="goods-ones flex-column" v-for="item in goods" @tap="gotoinfo">
						<image src="../../static/index/sp.png" mode="widthFix"></image>
						<view class="flex-row flex-content-between goods-ones-txt">
							<view class="flex-row">
								<view class="goods-ones-text1">￥60</view>
								<view class="goods-ones-text2">￥80</view>
							</view>
							<image @tap.stop="addCart" class="goods-ones-img1" src="../../static/index/jia.png" mode="scaleToFill"></image>
						</view>
						<view class="goods-ones-name flex-row flex-content-between">
							<view>乳山生蚝</view>
							<view>500g</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				goods:[
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					""
				]
			}
		},
		methods: {
			gotoinfo(){
				uni.navigateTo({
					url:'/pages/goods/goods_info'
				})
			},
			addCart(){
				console.log("添加购物车");
			}
		}
	}
</script>

<style lang="scss">
	.tuijian{
		font-size: 30rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #333333;
		margin-top: 60rpx;
		margin-left: 30rpx;
	}
	.goods-ones-name{
		margin-left: 16rpx;
		margin-right: 16rpx;
		margin-top: 14rpx;
		>view{
			font-size: 28rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #333333;
		}
		
	}
	.goods-ones-txt{
		margin-left: 10rpx;
		margin-top: 12rpx;
		margin-right: 16rpx;
	}
	.goods-ones-text1{
		font-size: 32rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: $default-button-color;
	}
	.goods-ones-text2{
		font-size: 24rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #CCCCCC;
		line-height: 40rpx;
		margin-left: 18rpx;
		text-decoration:line-through;
	}
	.goods-ones-img1{
		width: 34rpx;
		height: 34rpx;
	}
	/* #ifdef H5 */
	.goods-scroll{
		height: calc(100vh - 570rpx);
		// background-color: aqua;
	}
	/* #endif */
	/* #ifndef H5 */
	
	/* #endif */
	.goods-ones{
		width: 334rpx;
		height: 394rpx;
		background-color: #FFFFFF;
		margin-left: 22rpx;
		margin-right: 0rpx;
		margin-top: 30rpx;
		>image{
			width: 334rpx;
		}
	}
	.gooods-centent{
		margin-left: 8rpx;
		margin-right: 30rpx;
		
	}
	.gooods-header{
		// margin-top: 29rpx;
	}
	.banner{
		width: 750rpx;
		>image{
			width: 750rpx;
			margin-top: -100rpx;
		}
	}
	.header{
		width: 100%;
		height: 256rpx;
		background-image: url('../../static/index/bj.png');
		background-size: 100%;
		color: #FFFFFF;
		text-align: center;
		// padding-top: 82rpx;
	}
	.header-text{
		width: 100%;
		height: 82rpx;
	}
</style>
